<template>
  <div id="app">
    <audio
              loop="true"
              ebkit-playsinline="true"
              playsinline="true"
              ref="audio"
              :src="alarmVoice"
          ></audio>
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import Vue from "vue";
import ThemePicker from "@/components/ThemePicker";
import alarmVoice from '@/assets/audio/y2383.mp3'

export default {
  name: "App",
  mounted(){
    console.log("apppppp")
    this.audio = this.$refs.audio;
    let that =this;
    Vue.prototype.audioPlay = function () {
      let audio =that.audio;
      audio.play();
      }

      Vue.prototype.audioStop = function () {
      let audio =that.audio;
      console.log("stopppp")
      audio.pause();
      }
      Vue.prototype.audioIsPause = function () {
        let audio =that.audio;
        return audio.paused;
      
      }  

  },
   data(){
    return {
      alarmVoice: alarmVoice,
      audio:null
    }
   },
  components: { ThemePicker },
    metaInfo() {
        return {
            title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
            titleTemplate: title => {
                return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
            }
        }
    }
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
